/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.hieu.sms.model;

import java.util.Date;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * 
 * @author do_th
 */
@Entity
@Table(name = "graduated_student")
@NamedQueries({
		@NamedQuery(name = "GraduatedStudent.findAll", query = "SELECT g FROM GraduatedStudent g"),
		@NamedQuery(name = "GraduatedStudent.findById", query = "SELECT g FROM GraduatedStudent g WHERE g.id = :id"),
		@NamedQuery(name = "GraduatedStudent.findByTeacherId", query = "SELECT g FROM GraduatedStudent g WHERE g.teacherId = :teacherId"),
		@NamedQuery(name = "GraduatedStudent.findByDepId", query = "SELECT g FROM GraduatedStudent g WHERE g.depId = :depId"),
		@NamedQuery(name = "GraduatedStudent.findByGraduatedDate", query = "SELECT g FROM GraduatedStudent g WHERE g.graduatedDate = :graduatedDate"),
		@NamedQuery(name = "GraduatedStudent.findByScore", query = "SELECT g FROM GraduatedStudent g WHERE g.score = :score"),
		@NamedQuery(name = "GraduatedStudent.findByRank", query = "SELECT g FROM GraduatedStudent g WHERE g.rank = :rank") })
public class GraduatedStudent extends AbstractPersistentEntity {
	private static final long serialVersionUID = 1L;
	@Id
	@Column(name = "id", updatable = false)
	@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "GraduatedStudentSequence")
	@SequenceGenerator(name = "GraduatedStudentSequence", sequenceName = "seq_graduated_student", allocationSize = 1)
	private Long id;
	@Basic(optional = false)
	@Column(name = "teacher_id")
	private String teacherId;
	@Basic(optional = false)
	@Column(name = "dep_id")
	private String depId;
	@Column(name = "graduated_date")
	@Temporal(TemporalType.DATE)
	private Date graduatedDate;
	// @Max(value=?) @Min(value=?)//if you know range of your decimal fields
	// consider using these annotations to enforce field validation
	@Column(name = "score")
	private Float score;
	@Column(name = "rank")
	private String rank;

	public GraduatedStudent() {
	}

	public GraduatedStudent(Long id) {
		this.id = id;
	}

	public GraduatedStudent(Long id, String teacherId, String depId) {
		this.id = id;
		this.teacherId = teacherId;
		this.depId = depId;
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getTeacherId() {
		return teacherId;
	}

	public void setTeacherId(String teacherId) {
		this.teacherId = teacherId;
	}

	public String getDepId() {
		return depId;
	}

	public void setDepId(String depId) {
		this.depId = depId;
	}

	public Date getGraduatedDate() {
		return graduatedDate;
	}

	public void setGraduatedDate(Date graduatedDate) {
		this.graduatedDate = graduatedDate;
	}

	public Float getScore() {
		return score;
	}

	public void setScore(Float score) {
		this.score = score;
	}

	public String getRank() {
		return rank;
	}

	public void setRank(String rank) {
		this.rank = rank;
	}

	@Override
	public int hashCode() {
		int hash = 0;
		hash += (id != null ? id.hashCode() : 0);
		return hash;
	}

	@Override
	public boolean equals(Object object) {
		// TODO: Warning - this method won't work in the case the id fields are
		// not set
		if (!(object instanceof GraduatedStudent)) {
			return false;
		}
		GraduatedStudent other = (GraduatedStudent) object;
		if ((this.id == null && other.id != null)
				|| (this.id != null && !this.id.equals(other.id))) {
			return false;
		}
		return true;
	}

	@Override
	public String toString() {
		return "com.hieu.sms.model.GraduatedStudent[ id=" + id + " ]";
	}

}
